#include <bits/stdc++.h>

using namespace std;

int main()
{
    freopen("arena.in", "r", stdin);
    freopen("arena.out", "w", stdout);
    int n, m;
    cin >> n >> m;
    for(int i = 1; i <= n; i++){
        int a;
        cin >> a;
    }
    for(int i = 1; i <= m; i++){
        int c;
        cin >> c;
    }
    int g, r;
    cin >> g >> r;
    int t;
    while(t--){
        int x0, x1, x2, x3;
        cin >> x0 >> x1 >> x2 >> x3;
    }


    cout << "126395" << endl;
    return 0;
}
